package com.example.administrator.dagger2demo.ui.login;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;

import com.example.administrator.dagger2demo.R;
import com.example.administrator.dagger2demo.application.DemoApplication;
import com.example.administrator.dagger2demo.ui.Base2Activity;

/**
 * Created by Administrator on 2016/4/13.
 */
public class LoginActivity extends Base2Activity implements LoginContract.View {

    LoginContract.LoginActionsListener loginActionsListener;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        loginActionsListener = DaggerLoginContractComponent
                .builder()
                .appComponent(DemoApplication.getAppComponent())
                .loginPresenterModule(new LoginPresenterModule(this))
                .build().getLoginPresenter();
        Log.i("TAG",loginActionsListener ==null?"loginActionsListener==null":"loginActionsListener!=null");


    }

    @Override
    public int getContentView() {
        return R.layout.login;
    }

    @Override
    public boolean isShowLeftIcon() {
        return false;
    }

    @Override
    public boolean isShowRightIcon() {
        return false;
    }

    @Override
    public int setLeftIcon() {
        return R.mipmap.ic_launcher;
    }

    @Override
    public int setRightIcon() {
        return 0;
    }

    @Override
    public int showTitle() {
        return R.string.app_name;
    }

    public void ok(View view){
        loginActionsListener.login("1","1");
    }
    @Override
    public void showProgress() {

    }

    @Override
    public void closeProgress() {

    }

    @Override
    public void startShowView() {

    }

}
